/**
 * @file EulerAngles.h
 * @author  Aljosa Osep <aljosa.osep@gmail.com, Fletcher Dunn, Ian Parnberry>
 * @version 1.0
 *
 * @section LICENSE
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:

 *  1. Redistributions of source code must retain the above copyright notice, this list of
 *    conditions and the following disclaimer.

 *  2. Redistributions in binary form must reproduce the above copyright notice, this list
 *     of conditions and the following disclaimer in the documentation and/or other materials
 *     provided with the distribution.

 * THIS SOFTWARE IS PROVIDED BY <Aljosa Osep> ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <Aljosa Osep>> OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 * The views and conclusions contained in the software and documentation are those of the
 * authors and should not be interpreted as representing official policies, either expressed
 * or implied, of <Aljosa Osep>.
 *
 * @section DESCRIPTION
 *
 * EulerAngles - class representing euler angles triple, header
 * Based on examples from 3D Math Premier of Graphics and Games Development book
 * Original authors: Fletcher Dunn, Ian Parnberry. Thanks!
 */

#ifndef EULERANGLES_H
#define EULERANGLES_H

#include "Quaternion.h"


// Forward declarations
class Quaternion;
class RotationMatrix; // ?
class Matrix4x3; // ?

namespace xEngine
{
    namespace PlatformIndependent
    {
        namespace Math
        {

            /**
             * EulerAngles class
             *
             * Represents heading-pitch-bank angle transformation
             */
            class EulerAngles {
                public:
                float heading, pitch, bank; // every rotation can be represented by angles at cardinal axes

                // Constructors
                EulerAngles(); // Default - set angles to 0.0f
                EulerAngles(float h, float p, float b);

                // Operations
                void identity(); // Set angles to 0
                void canonize(); // Angles canonical form

                // Convert quaterion to Euler angle format; both object-to-inertial and inertial-to-object
                void fromObjectToInertialQuaternion(const xEngine::PlatformIndependent::Math::Quaternion &q);
                void fromInertialToObject(const Quaternion &q);

                // Matrix convertation not covered yet; TODO?



            };
        }
    }
}



#endif // EULERANGLES_H
